package com.cat.dataStructure;

/**
 *   @description https://leetcode.cn/problems/jump-game/description/?envType=study-plan-v2&envId=top-100-liked
 *   @author 曲大人的喵
 *   @create 2025/9/24 20:52
 *   @since JDK17
 */

public class Solution76 {
    public boolean canJump(int[] nums) {
        int n = nums.length - 1, max = 0;
        for (int i = 0; i < n && max >= i; i++) {
            max = Math.max(max, i + nums[i]);
        }
        return max >= n;
    }
}
